﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Djs.Tools.Tresor.Forms
{
    public partial class TestForm : Djs.Tools.Tresor.Gui.FillForm
    {
        public TestForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string file = @"C:\tresor.key";
            Data.TresorKey tKey = Data.TresorKey.CreateFromFile(file, "");
            Data.TresorLock tLock = Data.TresorLock.CreateFromKey(tKey);
            // tLock.UnlockWithPassword("");


        }

        private void button2_Click(object sender, EventArgs e)
        {
            using (CStream st = new CStream())
            using (var ms = new System.IO.FileStream("", System.IO.FileMode.Create))
            {
                // ms.

                if (st.CanWrite)
                {
                    //   System.IO.File.wri
                }
            }
        }
    }

    internal class CStream : System.IO.Stream
    {
        #region Stream
        public override bool CanRead
        {
            get { throw new NotImplementedException(); }
        }

        public override bool CanSeek
        {
            get { throw new NotImplementedException(); }
        }

        public override bool CanWrite
        {
            get { throw new NotImplementedException(); }
        }

        public override void Flush()
        {
            throw new NotImplementedException();
        }

        public override long Length
        {
            get { throw new NotImplementedException(); }
        }

        public override long Position
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public override int Read(byte[] buffer, int offset, int count)
        {
            throw new NotImplementedException();
        }

        public override long Seek(long offset, System.IO.SeekOrigin origin)
        {
            throw new NotImplementedException();
        }

        public override void SetLength(long value)
        {
            throw new NotImplementedException();
        }

        public override void Write(byte[] buffer, int offset, int count)
        {
            throw new NotImplementedException();
        }
        #endregion
    }
}
